from turtle import *
import types
from utils import absolute_move
class tree:
    __color1__ = (0, 160, 153)
    __color2__ = (60, 204, 132)
    __color3__ = (23, 130, 112)
    def __init__(self) -> None:
        __color1__ = (0, 160, 153)
        __color2__ = (60, 204, 132)
        __color3__ = (23, 130, 112)
    def setcolor(self,colors):
            self.__color1__=colors[0]
            self.__color2__=colors[1]
            self.__color3__=colors[2]
    def round(self,size,angle,space=None):
        if space==None:
            space=size
        seth(angle)
        circle(-size,180)
        seth(angle+90)
        pu()
        fd(space)
        pd()
    def tree(self,clor,size):
        getscreen().colormode(255)
        x=xcor()
        y=ycor()
        color(clor,clor)
        begin_fill()
        self.round(50*size,100)
        self.round(70*size,120)
        self.round(80*size,90)
        self.round(120*size,100,40*size)
        self.round(50*size,70)
        self.round(50*size,54,0)
        goto(x,y)
        end_fill()
    def run1(self):
        #3
        absolute_move(-220,30)
        self.tree(self.__color1__,1)
        #2
        absolute_move(-400,10)
        self.tree(self.__color2__,0.8)
        absolute_move(0,10)
        self.tree(self.__color2__,0.9)
        #1
        absolute_move(-310,-10)
        self.tree(self.__color3__,0.8)
        absolute_move(50,-10)
        self.tree(self.__color3__,0.6)
    def run2(self):
        absolute_move(-400,-460)
        self.tree((self.__color2__),1)
        absolute_move(100,-450)
        self.tree((self.__color2__),0.5)
